﻿<?php 

//Seyret Component v.0.3//
/**
* @package Seyret
* @version 0.3
* @copyright Copyright (C) 2008 Mustafa DINDAR. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Seyret Video Component is a free software.
* See seyrettos.html for license notices and details.
*/

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

$video=$this->video;

echo $this->toolbar;
echo $this->modtoolbar;


$resptype = Jrequest::getVar( 'rt', '', 'get' );
$cdatatype = Jrequest::getVar( 'cdt', '', 'get' );

if ($resptype!="json" && $cdatatype  !="0") {


//aşağıdaki videoanalyzeresponse divi desktop için gerekli
?>
<div id="videoanalyzeresponse">
<seyretxml>
	<info>
		<videodetails>
			<err><?php echo  $video->error; ?></err>
			<msg><![CDATA[<?php echo  $video->message; ?>]]></msg>
			<videotitle><![CDATA[<?php echo $video->videotitle; ?>]]></videotitle>
			<videodescription><![CDATA[<?php echo $video->videodescription; ?>]]></videodescription>
			<videothumbnail><?php echo  $video->videothumb; ?></videothumbnail>
			<videoservertype><?php echo  $video->videoservertype; ?></videoservertype>
			<videoservercode><?php echo  $video->videoservercode; ?></videoservercode>
			<videoduration><?php echo  $video->videoduration; ?></videoduration>
			<videotags><?php echo  $video->videotags; ?></videotags>
			<videolink><?php echo  $video->videolink; ?></videolink>
			
		</videodetails>
	</info>
</seyretxml>
</div>
<?php 


} if ($resptype!="json" && $cdatatype  =="0") {
//aşağıdaki videoanalyzeresponse divi desktop için gerekli
?>
<div id="videoanalyzeresponse">
<seyretxml>
	<info>
		<videodetails>
			<err><?php echo  $video->error; ?></err>
			<msg><?php echo  $video->message; ?></msg>
			<videotitle><?php echo $video->videotitle; ?></videotitle>
			<videodescription><?php echo $video->videodescription; ?></videodescription>
			<videothumbnail><?php echo  $video->videothumb; ?></videothumbnail>
			<videoservertype><?php echo  $video->videoservertype; ?></videoservertype>
			<videoservercode><?php echo  $video->videoservercode; ?></videoservercode>
			<videoduration><?php echo  $video->videoduration; ?></videoduration>
			<videotags><?php echo  $video->videotags; ?></videotags>
			<videolink><?php echo  $video->videolink; ?></videolink>
			<embedcode><?php echo  base64_encode($video->embedcode); ?></embedcode>
			
		</videodetails>
	</info>
</seyretxml>
</div>
<?php 


} else {

//Json response

?>

{
error: '<?php echo  $video->error; ?>', 
msg: '<?php echo  $video->message; ?>', 
videotitle: '<?php echo str_replace("'", "&#39;", $video->videotitle); ?>', 
videodescription: '<?php echo  str_replace("'", "&#39;", $video->videodescription); ?>',
videothumbnail: '<?php echo  $video->videothumb; ?>',
videoservertype: '<?php echo  $video->videoservertype; ?>',
videoservercode: '<?php echo  $video->videoservercode; ?>',
embedcode: '<?php echo  $video->embedcode; ?>'
}

<?php 

}

?>